UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kvcrw1EWNhzyEoNuCydCtJS01R98NZfsNik4DFjcIHY='
WHERE
key_id = '09794aae7e5372aeedaa6acc4800e1828322995d54640976495fdb96a9636e18'
AND (
token = 'kvcrw1EWNhzyEoNuCydCtJS01R98NZfsNik4DFjcIHY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)