UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'j2MGr5grVOQUcKekcw5gnoNEf1hiUw4B9bLECkKunNk='
WHERE
key_id = '1a492b64284ba93ece71412f41fa682fb6c351e4ccfbdf66c91fc610942f788c'
AND (
token = 'j2MGr5grVOQUcKekcw5gnoNEf1hiUw4B9bLECkKunNk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)