UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qxRj39MeiBm0xBYRiAQ9Fa2+rsDHRZPUzEEzMucMLfQ='
WHERE
key_id = '233af5d98bb8fab380e75f39631b8ec9d26893264e4da505c603ada26b3b44bf'
AND (
token = 'qxRj39MeiBm0xBYRiAQ9Fa2+rsDHRZPUzEEzMucMLfQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)