UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2R1WNVQ8CD0M3QlqZRAEwcjta2SWygPsCZhFQtnpWMM='
WHERE
key_id = '076aa646dba5dcbff774abdb6ab1646a11c9922452ac3fd3531c4a8c9a8daf97'
AND (
token = '2R1WNVQ8CD0M3QlqZRAEwcjta2SWygPsCZhFQtnpWMM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)