UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XVgRR1VBfxFiS+DH/Vrh+XQEmqfylNedCS//rPwWBNQ=' 
WHERE 
  key_id = 'd4e62cbaf586ab46b3b2eb2ff067d28fabb896aeb9d76c5ebfffa1a5761e2660' 
  AND (
    token = 'XVgRR1VBfxFiS+DH/Vrh+XQEmqfylNedCS//rPwWBNQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043