UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YBKSfsZMfUuSXpFy37GdKukxH5/CLMe+T9vM85Jj4zc=' 
WHERE 
  key_id = 'b8759127b890abbb09f35f9a75811a380092c9d707ec491ec4b5854145a17544' 
  AND (
    token = 'YBKSfsZMfUuSXpFy37GdKukxH5/CLMe+T9vM85Jj4zc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044