UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gllxf5CWLlFCyniSgRuBR3dTBICemXkUmphdyuYoimM=' 
WHERE 
  key_id = 'f00268a30174f72d46ca4ffa1efa0ee5ebd71563a2934627c213936f708a7e6d' 
  AND (
    token = 'gllxf5CWLlFCyniSgRuBR3dTBICemXkUmphdyuYoimM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029