UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'b2BOk4dkkfVhVMcxnzBLZ9PEEIib4jqiK/2qfSj9U94=' 
WHERE 
  key_id = 'f60c246fe2ea496e947ca3bfe3eba74008545169da3b2836bac214e520dbe68f' 
  AND (
    token = 'b2BOk4dkkfVhVMcxnzBLZ9PEEIib4jqiK/2qfSj9U94=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038