UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '78Fo7oAIb7++2tFnj1snNPJq2xDPeceCd/Gcn7a7BrI=' 
WHERE 
  key_id = '0eee069bbee0728f99627053dbb442a6b388c49cd513d39adcde6da2217b051a' 
  AND (
    token = '78Fo7oAIb7++2tFnj1snNPJq2xDPeceCd/Gcn7a7BrI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037