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

Query time 0.00039