UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YRX7VsnE/ljiiimcAm7vagfZDRVTzU3RP5p2ebD6PzI='
WHERE
key_id = 'fc4fe70fc022271e09f85498869a44dea3c8f9eb25d4f801294b8356dfe31be1'
AND (
token = 'YRX7VsnE/ljiiimcAm7vagfZDRVTzU3RP5p2ebD6PzI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)