UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YTqn3GRNtdrEfyNqcdGe+g1pCLyw+IMMhZORDFaYAmk='
WHERE
key_id = '0442c6bd41f99979b8c82d979886daf4840720974ff98286bc83613a3b199d12'
AND (
token = 'YTqn3GRNtdrEfyNqcdGe+g1pCLyw+IMMhZORDFaYAmk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)