UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Te3M5ukSr4oPKyuBIO4XgUKM2V7o5Ge7H1mDcpflZvA='
WHERE
key_id = '9ca6002a6c6ebf2961720ee756937cbe26caf256b1eb024eb7e0a19aa943291e'
AND (
token = 'Te3M5ukSr4oPKyuBIO4XgUKM2V7o5Ge7H1mDcpflZvA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)