UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7p2gyEIkdkaHMCHSnUGR9KT1c7Q/O9Dc1zEpUMtrXDU=' 
WHERE 
  key_id = '0f990d472968d44c86914857c27090e200c624ac5b41fa4802bdbd0c05bce1c1' 
  AND (
    token = '7p2gyEIkdkaHMCHSnUGR9KT1c7Q/O9Dc1zEpUMtrXDU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034