UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eUuM+KlpDuynaFwxsR7PBo7nSefLjDnZHuoCIq3NbPE=' 
WHERE 
  key_id = '1894bb330e8f24b04f452082d0628a82b47aa2ede3fab4a8d9526be4c0bbe5a1' 
  AND (
    token = 'eUuM+KlpDuynaFwxsR7PBo7nSefLjDnZHuoCIq3NbPE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038