UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BXrdxdEJ82YYDk7BHbREWt8zkeyAtTYmOf0K6E55TBU='
WHERE
key_id = '53e7fff356d59bb75ff02fa71c94027f10929adc1bc93a0aaeb78cb173c19aaf'
AND (
token = 'BXrdxdEJ82YYDk7BHbREWt8zkeyAtTYmOf0K6E55TBU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)