UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xaJYWtBOAljRNctdIEjVTmTEb1MC6lLmAie874Qnd1E='
WHERE
key_id = 'e140d4b6f466693f053cc23ac2f66ee66ebbbb8a48baac1ed4a2987ccaf24a79'
AND (
token = 'xaJYWtBOAljRNctdIEjVTmTEb1MC6lLmAie874Qnd1E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)