UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DCvuZMVLFmg3rqyIkaoldbIOW9Y9T58rdnArRwj+LIo=' 
WHERE 
  key_id = 'e11234d65f2543020935b9bd6eb2244aa396ba5994c24df0e52d9cfb3296dc62' 
  AND (
    token = 'DCvuZMVLFmg3rqyIkaoldbIOW9Y9T58rdnArRwj+LIo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030