UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PQGCAStuPS+m/Csk6wGNeXSDGDugwpJcyFdTqdk6RXI=' 
WHERE 
  key_id = '97e7d14a7797d9aef366af4594453c08671f8a9d4acd973ca58ff551966eb6cf' 
  AND (
    token = 'PQGCAStuPS+m/Csk6wGNeXSDGDugwpJcyFdTqdk6RXI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022