UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3VXHmXbJsIJCdrPHhesEMJP5Ya/JmiFKQn8oqRXTNko='
WHERE
key_id = 'ef64ed2fea42f2088a60e1ef6cae7e312ff73b389687e501318d070aa0dc391e'
AND (
token = '3VXHmXbJsIJCdrPHhesEMJP5Ya/JmiFKQn8oqRXTNko='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)