UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EYlzLpS0FAVTpZBj/u3WsQXTkvmZ753kwjiuUDmPfkk=' 
WHERE 
  key_id = '518c375b66a12fad753b4478656c3575bc3b68e28b99b0c7bf8b83f27b8f9e85' 
  AND (
    token = 'EYlzLpS0FAVTpZBj/u3WsQXTkvmZ753kwjiuUDmPfkk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018