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