UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'J3+KrtwXsKb4/+C+p1d0juanmNhmpVS6qVV4ee1vxUA=' 
WHERE 
  key_id = '113bbb0ee8dd5feb07ccb1e96a7a23ec8d3c213647bfe60f6e70c4ca7ca88e7a' 
  AND (
    token = 'J3+KrtwXsKb4/+C+p1d0juanmNhmpVS6qVV4ee1vxUA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016