UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tL3X2nSOGxbN0kWx1CpkjcyQ7xCBz/2WFQO9Y+iRbD0='
WHERE
key_id = '75c7840e760a0b92364d108426708add63aff624c151e93586ed561e804ac806'
AND (
token = 'tL3X2nSOGxbN0kWx1CpkjcyQ7xCBz/2WFQO9Y+iRbD0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)