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