UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UnK9RS56bJGhLTPqusVhBfzk8O/EKi3pGcfdaRBmFZ4=' 
WHERE 
  key_id = 'fbdb3342aa1736789e385c2b5c2b17f555c9d1a701a47278a15d4268e4cbf37e' 
  AND (
    token = 'UnK9RS56bJGhLTPqusVhBfzk8O/EKi3pGcfdaRBmFZ4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037