UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'j53/HpcldYmhk1EgzhjSytQrJC3Qk5TiCDDhrikeMY4='
WHERE
key_id = '8ab9822e80fe24f799121c33d7c3b89e6bbe2b581d296577d6339165984a7255'
AND (
token = 'j53/HpcldYmhk1EgzhjSytQrJC3Qk5TiCDDhrikeMY4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)