UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4gsxoH3Aq2s8SByDR1HbGfbiFRX9wGugWwI8MVYFhVg=' 
WHERE 
  key_id = '0be5fe2213702be41741ede53cad050579b8ee685446b93081c8b70858583a82' 
  AND (
    token = '4gsxoH3Aq2s8SByDR1HbGfbiFRX9wGugWwI8MVYFhVg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00061