UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VltmZ9hjtOUlVZllZfwGDjd5Gpo2D4AvwhxmDir5ivc='
WHERE
key_id = '7b624d81177d5443a66bac7e7b9b6418174d9cd519bce61ee6bb3b1c10ac75a7'
AND (
token = 'VltmZ9hjtOUlVZllZfwGDjd5Gpo2D4AvwhxmDir5ivc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)