UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zl0svyItEMV6vRweLLhpLATUpvY/9HsbFfoFSpCaxC4=' 
WHERE 
  key_id = '0e2bfb2c5545c5bc5947ee30ebd8b365c876ee891e7e6a1d6b33dfed06b0d512' 
  AND (
    token = 'zl0svyItEMV6vRweLLhpLATUpvY/9HsbFfoFSpCaxC4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038