UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'r5bF/sdeC7oTlCbA//L4BAsUXEUbiIVcUBy5krUcUGU=' 
WHERE 
  key_id = 'a01e65be5e8e25aaac1f20c03ffc915452c6a3ae4d4fde720313c27ea45aca33' 
  AND (
    token = 'r5bF/sdeC7oTlCbA//L4BAsUXEUbiIVcUBy5krUcUGU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00069