UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GHViTlGCsBIg7omUkQwfy2Vca6Zztqcrx1fpO6eVJMA='
WHERE
key_id = 'ae3c3758191e65f170ad849db02ae088d6d586e183c3e86026e9861248a341b2'
AND (
token = 'GHViTlGCsBIg7omUkQwfy2Vca6Zztqcrx1fpO6eVJMA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)